<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core'%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /><!-- 控制浏览器文件模式为IE8 -->
<title>新增操作項</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="js/artDialog/skins/default.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/elegant/om-all.css" />
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script src="js/main.js" type="text/javascript"></script>
<script type="text/javascript" src="js/selfpagination.js"></script>
<script src="js/artDialog/artDialog.js?skin=blue"></script>
<script src="js/artDialog/plugins/iframeTools.js"></script>
<script type="text/javascript" src="js/operamasks-ui.min.js"></script>
<script language="javascript">
	
	function addOption(){
		var functionId = $("#functionId").val();
		var optionCode = $("#optionCode").val();
		var optionName = $("#optionName").val();
		$.ajax({
			url : "${pageContext.request.contextPath}/adminFunction.do?action=addOption",
			cache : false,
			async : false,
			type : 'post',
			dataType : "text",
			data : {
				"functionId" : functionId,
				"optionCode" : optionCode,
				"optionName" : optionName
			},
			error : function(){//请求失败处理函数
				alert("操作失敗,請聯繫管理員!");
			},
			success : function(mage){
				if(mage =='SUCCESS'){
					alert("新增成功！");
					window.close();
					
				}else{
					alert("新增失敗！");
				}				
			}
		});	
		
	}
</script>
</head>
<body>
	<div class="place">	    
		<span>新增操作項</span>
    </div>
    <input type="hidden" id="functionId" value="${functionId}"/>
	<div style="margin-top:10px">
			<ul class="forminfo">
				<li>
					<label style="width:90px;display:inline-block">操作項代碼：</label>
					<input id="optionCode" type="text"  name="optionCode"  style="width:150px;height:32px;" class="scinput" />
					<i>*必填</i>
				</li>				
			</ul>
			<ul class="forminfo">
				<li>
					<label style="width:90px;display:inline-block">操作項名稱：</label>
					<input id="optionName" type="text" name="optionName" style="width:150px;height:32px;" class="scinput" />
					<i>*必填</i>
				</li>				
			</ul>
          	<ul class="forminfo" style="margin-top:30px;">
			    <li>
					<label>&nbsp;</label>
					<input name="" type="button" id="save" onclick="addOption();" class="btn" value="新增"/> 		
				</li>
		    </ul> 
		    </div> 
</body>
</html>